@extends('home.pc.public.public')

@section('main')
    <div class="miya_page_about">
        <div class="miya_page_about_left">
            <div class="miya_template_left_box">
                <h3 class="miya_template_left_box_title">{{ $page['label_name'] }}</h3>
                <ul class="miya_template_left_box_ul">
                    @foreach($pages[$page['label']] as $value)
                        <li><a href="{{ route('page',[$page['label'],$value['id']]) }}">{{ $value['name'] }}</a></li>
                    @endforeach
                </ul>
            </div>
            @include('home.pc.public.left')
        </div>
        <div class="miya_page_about_right frame_box">
            <h3 class="miya_page_about_right_title">{{ $page['name'] }}</h3>
            <p class="miya_page_about_date">发布时间 : {{ $page['updated_at'] }}</p>
            @include('home.pc.public.frame')
            <div class="miya_page_about_right_describe">{!! $page['describe'] !!}</div>
            <div class="miya_page_connect_right_map" id="allmap1"></div>
        </div>
        <div class="clearfix"></div>
    </div>

    <script type="text/javascript"
            src="http://api.map.baidu.com/api?v=2.0&ak=ADd1HT1EMAyEBnx4fxijrNAr6ejjZ0C6"></script>
    <script>
        //如何得到经纬度?
        console.log('可通过百度地图JS Api得到对应地区的经纬度\n' +
            'http://lbsyun.baidu.com/jsdemo.htm#f0_3');

        var jingdu = {{ $page['extend_field_1'] }};
        var weidu = {{ $page['extend_field_2'] }};

        var map1 = new BMap.Map('allmap1');
        map1.centerAndZoom(new BMap.Point(jingdu, weidu), 18);
        map1.enableScrollWheelZoom(true);

        var point1 = new BMap.Point(jingdu, weidu);
        var marker1 = new BMap.Marker(point1);  // 创建标注
        map1.addOverlay(marker1);               // 将标注添加到地图中
        marker1.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
    </script>
@endsection